package com.youkeyi.ddy.cloud.common.enums;

/**
 * @author Administrator.
 * @date 2021/03/25.
 * @time 11:20
 **/
public enum ResponseCodeEnum {
    SUCCESS(0, "成功"),
    FAIL(-1, "失败"),
    LOGIN_ERROR(1000, "用户名或密码错误"),
    UNKNOWN_ERROR(2000, "未知错误"),
    PARAMETER_ILLEGAL(2001, "参数不合法"),
    TOKEN_INVALID(2002, "无效的Token"),
    TOKEN_SIGNATURE_INVALID(2003, "无效的签名"),
    TOKEN_EXPIRED(2004, "token已过期"),
    TOKEN_MISSION(2005, "token缺失"),
    REFRESH_TOKEN_INVALID(2006, "刷新Token无效"),
    UNKNOWN_CORP_TYPE_ERROR(2007, "未知的主体类型"),
    OLD_PASSWORD_INVALID(90001, "旧密码不匹配，修改密码失败"),

    // system
    SYSTEM_UNKNOWN_POSITION_CODE_ERROR(31000, "未知的岗位"),
    SYSTEM_SALES_UPDATE_ERROR(31001, "该销售单无法执行此操作"),
    SYSTEM_PURCHASE_UPDATE_ERROR(31001, "该采购单无法执行此操作"),
    // web
    SUPPLY_CHAIN_WEB_DAMAGE_NUMBER_LARGE_ERROR(32001, "报损数量过大"),
    // uas
    UAS_CREATE_ROOT_USER_FAIL(30001, "创建主体根用户失败"),
    UAS_UPDATE_CORP_AUTH_FAIL(30002, "更新主体权限失败"),
    UAS_UPDATE_USER_ACCOUNT_PHONE_FAIL(30003, "存在手机号或者账号重复"),

    // crm
    CRM_EMAIL_INVALID(40000, "无效的Email"),

    // hr
    HR_APPROVAL_NODE_QUERY_ERROR(50000, "审批节点查询为空"),
    HR_APPROVAL_NODE_APPROVAL_ERROR(50001, "您无权审批"),

    ;


    private int code;

    private String message;

    ResponseCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
